// package com.zmn.oms.zmn.business.impl.comment;
//
// import com.google.common.collect.Lists;
// import com.zmn.brs.common.enums.EventEnum;
// import com.zmn.brs.common.enums.RecordFieldEnum;
// import com.zmn.brs.starter.annotation.RecordField;
// import com.zmn.brs.starter.annotation.StaffOperateRecord;
// import com.zmn.common.utils.reflect.BeanMapper;
// import com.zmn.oms.business.impl.base.AbstractListEsQueryServiceImpl;
// import com.zmn.oms.business.interfaces.comment.OrderCommentListBService;
// import com.zmn.oms.common.constant.OrderConsts;
// import com.zmn.oms.common.constant.OrderStatusConsts;
// import com.zmn.oms.model.entity.comment.OrderCommentEsQuery;
// import com.zmn.base.oms.common.model.es.orderwork.EsOrderWorkComment;
// import com.zmn.oms.model.vo.comment.ZsOrderCommentVO;
// import com.zmn.oms.zmn.business.interfaces.comment.ZsOrderCommentQueryBService;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.stereotype.Service;
//
// import java.util.List;
// import java.util.Objects;
//
// /**
//  * 类描述：订单评价查询
//  *
//  * @author lujia
//  * @date 2018/12/28 20:14
//  */
// @Service
// public class ZsOrderCommentQueryBServiceImpl extends AbstractListEsQueryServiceImpl implements ZsOrderCommentQueryBService {
//
//     @Autowired
//     OrderCommentListBService orderCommentListBService;
//
//     @StaffOperateRecord(staffId = "{{#query.staffId}}",
//             event = EventEnum.WORK_ORDER_QUERY,
//             mapping = {
//                     @RecordField(field = RecordFieldEnum.STAFF_IP, value = "{{#query.ip}}"),
//                     @RecordField(field = RecordFieldEnum.PLAT, value = "{{#query.platWork}}")
//             })
//     @Override
//     public List<ZsOrderCommentVO> listPageOrderPartByQuery(OrderCommentEsQuery query) {
//         return baseListPageOrderPartByQuery(query);
//     }
//
//
//     @StaffOperateRecord(staffId = "{{#query.staffId}}",
//             event = EventEnum.WORK_ORDER_EXPORT,
//             mapping = {
//                     @RecordField(field = RecordFieldEnum.STAFF_IP, value = "{{#query.ip}}"),
//                     @RecordField(field = RecordFieldEnum.PLAT, value = "{{#query.platWork}}")
//             })
//     @Override
//     public  List<ZsOrderCommentVO> exportListOrderPartByQuery(OrderCommentEsQuery query){
//         return baseListPageOrderPartByQuery(query);
//     }
//
//
//     private List<ZsOrderCommentVO> baseListPageOrderPartByQuery(OrderCommentEsQuery query) {
//
//         List<EsOrderWorkComment> esOrderWorkComments = orderCommentListBService.listPageOrderCommentByQuery(query);
//         List<ZsOrderCommentVO> orderCommentVOList = Lists.newArrayListWithExpectedSize(esOrderWorkComments.size());
//         for (EsOrderWorkComment esOrderWorkComment : esOrderWorkComments) {
//             ZsOrderCommentVO commentVO = BeanMapper.map(esOrderWorkComment, ZsOrderCommentVO.class);
//             commentVO.setTypeName(OrderConsts.getCommentTypeName(esOrderWorkComment.getType()));
//             Integer resultStatus = esOrderWorkComment.getResultStatus();
//             commentVO.setSuccessOrder(Objects.equals(OrderStatusConsts.WORK_RESULT_SUCCESS, resultStatus) ? OrderConsts.YES_MSG : OrderConsts.NO_MSG);
//             orderCommentVOList.add(commentVO);
//         }
//         return orderCommentVOList;
//     }
// }
